gl renderer: Use premultiply() in inset shadow shader`
authorTimm Bäder <mail@baedert.org>
Wed, 30 Sep 2020 04:00:50 +0000 (06:00 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 14 Oct 2020 19:06:12 +0000 (15:06 -0400)
gsk/resources/glsl/inset_shadow.glsl

index 6047946784ddf19ebb87d9e210bf2a94636eb88d..9a21cdef097fb4d3d6ae4edbc5fec59cbd77d173 100644 (file)
@@ -11,9 +11,7 @@ _OUT_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
 void main() {
   gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
 
-  final_color = u_color;
-  final_color.rgb *= final_color.a;
-  final_color *= u_alpha;
+  final_color = gsk_premultiply(u_color) * u_alpha;
 
   GskRoundedRect outside = gsk_create_rect(u_outline_rect);
   GskRoundedRect inside = gsk_rounded_rect_shrink(outside, vec4(u_spread));